1. Field of the Invention
The present invention relates to a video coding apparatus for coding a video signal in a transmission bit rate limited based on a coding parameter.
2. Description of the Related Art
In recent years, a video signal can be transmitted and received through a transmission path and can be stored in storage media because of the development of communication technology and an improvement in an infrastructure. In general, the video signal has a large information amount. In the case in which the video signal is to be transmitted by using a transmission path having a limited transmission bit rate or the video signal is to be stored in storage media having a limited storage capacity, therefore, a technique for compressing and coding a video signal is indispensable. As one of methods of compressing and coding a video signal, there has been proposed an MPEG (Moving Picture Expert Group) in which ISO/IEC progresses a standardization, which is a technique for reducing a redundancy utilizing the time correlation and spatial correlation of a video signal, thereby decreasing the information amount of the video signal and carrying out coding to obtain a video signal satisfying a bit rate of a transmission path or a bit rate for recording in storage media.
In the compression and coding of the video signal, the video signal is coded to have a limited bit rate. For this reason, a coding bit amount to be assigned to one image constituting a video is restricted and the picture quality of the image is deteriorated according to a transmission bit rate. In particular, in the case in which the inside of a screen is to be coded uniformly, the picture quality becomes uniform in the screen, that is, a deterioration in the picture quality also becomes uniform.
For example, video coding in a TV conference will be considered. If a user uniformly codes the inside of the screen although he (she) originally desires that the picture quality of a face portion should be more excellent than that of a background portion, the picture quality of the face portion which is important for the TV conference becomes equivalent to that of the background portion which is not important. Consequently, a video obtained after the coding does not satisfy a subjective picture quality which reflects the user's intention.
In the screen, there are present an important area for the user and an area which is not important. The user desires that the important area should have a high visibility. Subsequently, the important area for the user is defined to be an “important area”, and a face portion that the user wants to see in the TV conference is set to be the important area, for example.
As a technique capable of carrying out coding to reflect the user's intension, there has been proposed a method of setting the picture quality of an important area to be more excellent than that of another area. For example, in a method described in ISO/IEC JTC1/SC29/WG11 MPEG95/030, an important area is selected from a dynamic image and a quantization value is changed to set the picture quality of the important area to be more excellent than that of another area.
In this method, moreover, the selected area is set to have a high picture quality. In the case in which the important area moves over the screen, therefore, it is necessary to select the important area at any time in order to maintain the picture quality of the important area to be high. Therefore, there can be supposed a method of setting a detected important area to have a high picture quality by utilizing detecting means for automatically detecting the important area.
Examples of this method include an image compressing and coding apparatus (hereinafter referred to as a conventional example) described in JP-A-10-23432. In the conventional example, a prestored pattern and an input image are matched to give a high picture quality to an area which is coincident with the pattern.
A method according to the conventional example will be described below. FIG. 8 is a block diagram showing the conventional example. In FIG. 8, a compressing and coding apparatus 5001 is constituted to have a motion estimating section 5002, a DCT (Discrete Cosine Transform) section 5003, a quantizing section 5004, a variable-length coding section 5005, a header adding section 5006, a decoding section 5007, a priority coding specifying section 5008, a code amount comparing section 5009 and a coding parameter determining section 5010.
Description will be given to the operation of the compressing and coding apparatus having the structure described above. An input image is coded on a macro block unit constituted by 16×16 pixels. The motion estimating section 5002 compares the similarities of a reference image and an input image which are output from the decoding section 5007 which will be described below, thereby calculating a differential value from an area having a high similarity. The output of the motion estimating section 5002 has two modes. The two modes include a mode 1 for outputting the differential value and a mode 2 for exactly outputting an input. These modes are determined by the coding parameter determining section 5010 which will be described below.
The DCT section 5003 orthogonally transforms an image output from the motion estimating section 5002 and outputs the result of the transformation to the quantizing section 5004. The quantizing section 5004 divides an orthogonal transformation coefficient output from the DCT section 5003 by a quantization value output from the coding parameter determining section 5010 which will be described below, and outputs a result to the variable-length coding section 5005. The variable-length coding section 5005 variable-length codes the result of quantization which is output from the quantizing section 5004, and outputs the variable-length coded result to the header adding section 5006.
The header adding section 5006 adds a necessary header to a code output from the variable-length coding section 5005 and outputs a coded video signal to the decoding section 5007 and the outside, and outputs the generated code amount to the code amount comparing section 5009. The decoding section 5007 decodes the coded video signal output from the header adding section 5006, and outputs a reference image to the motion estimating section 5002. The code amount comparing section 5009 compares a predetermined target code amount with the generated code amount output from the header adding section 5006, and outputs a remainder code amount to be the difference to the coding parameter determining section 5010.
The priority coding specifying section 5008 compares a prestored pattern with a similarity to the input image. If a degree of coincidence is equal to or more than a certain threshold, an instruction for priority coding is output to the coding parameter determining section 5010. The coding parameter determining section 5010 determines a quantization value and a motion estimating mode by using the remainder code amount output from the code amount comparing section 5009, outputs the quantization value to the quantizing section 5004 and outputs the motion estimating mode to the motion estimating section 5002.
For example, if the remainder code amount is small, the mode 1 using a differential value is set or the quantization value is increased to decrease the generated code amount. To the contrary, if the remainder code amount is large, the mode 2 using an input image is set or the quantization value is decreased to increase the generated code amount. In the case in which the instruction for priority coding is output from the priority coding specifying section 5008, the mode 2 using an input image is set or the quantization value is decreased to carry out control such that a large code amount is assigned to a macro block to which the instruction for priority coding is given. Thus, it is possible to enhance a picture quality by assigning a large code amount to the macro block to which the instruction for priority coding is given.
However, precision in the detection of an important area is not always 100%. For this reason, the detected area is not completely coincident with a real important area and is shifted from the real area or completely gets out of the real area in some cases. In these cases, a picture quality in the detected area is enhanced, resulting in a reduction in the visibility of the real important area which gets out of the detected area.
Moreover, the priority coding specifying section 5008 detects an area which is coincident with the important area by a certain threshold or more and carries out a constant enhancement in the picture quality irrespective of the degree of the coincidence with the important area. Therefore, the effects of the enhancement in the picture quality are committed to threshold setting. For example, in the case in which the threshold is small, a constant enhancement in the picture quality is carried out even in an image having a low degree of coincidence, that is, an area having a low probability of the important area so that the code amount is used wastefully. For this reason, it is impossible to assign a large code amount to the important area in which a picture quality is to be originally enhanced, thereby improving the picture quality.
To the contrary, in the case in which the threshold is great, a constant enhancement in a picture quality is carried out only for an image which is completely coincident with a pattern, resulting in a reduction in a probability that the picture quality of the important area will be enhanced. On the other hand, a picture quality is deteriorated in an important area which has a high probability of the important area and does not satisfy the threshold.
If a constant enhancement in the picture quality is carried out for only the area having the degree of the coincidence with the important area which is equal to or higher than the threshold irrespective of the degree of the coincidence, an enhancement in the picture quality cannot be performed according to the degree of the coincidence and the visibility of the important area is deteriorated in some cases. The enhancement in the picture quality according to the degree of the coincidence implies that the picture quality is more enhanced with an increase in the degree of the coincidence with the important area.
In this specification, hereinafter, a degree of coincidence of the detected area with the real important area is defined to be a “reliability” and a high reliability implies that a probability of the detected area to be the real important area is high, that is, precision in detection is high.